#include<iostream>

/*class Singleton{
private:
  static Singleton _eton;
  Singleton():_data(99){
    std::cout<<"单列对象构造"<<std::endl;
  }
  Singleton(const Singleton&)=delete;
  ~Singleton(){}
private:
  int _data;
public:
  static Singleton &getInstance()
  {
    return _eton;
  }
  int getData(){ return _data;}
};
Singleton Singleton::_eton;*/

class Singleton{
   private:
   Singleton():_data(99){
    std::cout<<"单列对象构造\n";
   }
   Singleton(const Singleton&)=delete;
   ~Singleton(){}
   private:
   int _data;
   public:
   static Singleton &getInstance()
   {
    static Singleton _eton;
    return _eton;
   }
   int getData()
   {
    return _data;
   }

};

int main()
{
    std::cout<<Singleton::getInstance().getData()<<std::endl;
    return 0;
}